package com.party.web.web.security;

import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * @ClassName MyUsernamePasswordToken
 * @Description TODO
 * @Author yifeng
 * @Date 2019/1/28 10:55
 **/
public class MyUsernamePasswordToken extends UsernamePasswordToken {
    private String loginType;

    public MyUsernamePasswordToken() {
        super();
    }

    /**
     * 账号密码登录
     */
    public MyUsernamePasswordToken(String username, String password, String loginType, boolean rememberMe, String host) {
        super(username, password, rememberMe, host);
        this.loginType = loginType;
    }

    /**
     * 免密登录
     */
    public MyUsernamePasswordToken(String username) {
        super(username, "", false, null);
        this.loginType = LoginType.NOPASSWD.getCode();
    }

    public MyUsernamePasswordToken(String username, String password) {
        super(username, password, false, null);
        this.loginType = LoginType.PASSWORD.getCode();
    }

    public String getLoginType() {
        return loginType;
    }

    public void setLoginType(String loginType) {
        this.loginType = loginType;
    }
}
